﻿using System;

namespace TextEditor
{
   

    public class A_AlignCenter : A_Action
    {
        public override string ActionName()
        {
            return "aligncenter";
        }

        public override int CheckState()
        {
            ZYTextParagraph ownerParagraph = base.myOwnerDocument.GetOwnerParagraph();
            if ((ownerParagraph != null) && (ownerParagraph.Align == ParagraphAlignConst.Center))
            {
                return 1;
            }
            return 0;
        }

        public override bool Execute()
        {
            base.myOwnerDocument.SetAlign(ParagraphAlignConst.Center);
            return true;
        }

        public override bool isEnable()
        {
            return base.myOwnerDocument.CanModify();
        }
    }
}

